Dotted Line
Stroke drawingStroke = new BasicStroke(3, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 0, new float[]{9}, 15); Graphics g=getG(); Graphics2D g2d = (Graphics2D) g; g2d.setStroke(drawingStroke); g.drawLine(40,40,120,200);